//
//  OpenAppManage.m
//  IPCamera
//
//  Created by 宣佚 on 15/6/3.
//  Copyright (c) 2015年 Andon Health Co,.Ltd. All rights reserved.
//

#import "OpenAppManage.h"

@implementation OpenAppManage

+(instancetype)sharedHandler
{
    static OpenAppManage *_sharedHandler = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedHandler = [[OpenAppManage alloc] init];
    });
    return _sharedHandler;
}

-(BOOL)isFirstOpenApp
{
    NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
    if (![userDefault boolForKey:@"everLaunched"]){
        [userDefault setBool:YES forKey:@"everLaunched"];
        [userDefault setBool:YES forKey:@"firstLaunch"];
    }
    else {
        [userDefault setBool:NO forKey:@"firstLaunch"];
    }
    [userDefault synchronize];
    if ([userDefault boolForKey:@"firstLaunch"]) {
        return YES;
    }
    else {
        return NO;
    }
}

@end
